package com.elegantmall.controller;


import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import com.elegantmall.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



@RestController
@CrossOrigin
public class UserController {

    @Autowired
    UserServiceImpl userService;
    @PostMapping("/updateUser")
    public SaResult updateUser(@RequestParam String username, @RequestParam String newPassword, @RequestParam String newNickname) {
        return userService.updateUser(username, newPassword, newNickname);
    }
    @PostMapping("/updateUserContact")
    public SaResult updateUserContact(@RequestParam String username, @RequestParam String address, @RequestParam String telephone) {
        return userService.updateUserContact(username, address, telephone);
    }
    @GetMapping("/getUserContact")
    public SaResult getUserContact(@RequestParam String username) {
    return userService.getUserContact(username);
}






}
